package com.pine.app.module.security.core.config;

import com.pine.app.module.security.core.web.xss.XssCheckFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static com.pine.app.module.security.core.config.XssCheckProperties.XSS_PROPERTIES;


/**
 * @author xiaoyuan
 * @create 2020/3/13 15:57
 **/
@Configuration
@ConditionalOnProperty(prefix = XSS_PROPERTIES, name = "enabled", havingValue = "true",matchIfMissing = false)
public class XssCheckConfig {



    @Autowired
    private XssCheckProperties xssProperties;


    @Bean
    public XssCheckFilter XssFilter(){
        return new XssCheckFilter(xssProperties);
    }
}
